package com.liuhengjia.springaiapply.initialize;

import com.liuhengjia.springaiapply.service.OAService;
import org.springframework.ai.model.function.FunctionCallback;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 工具初始化类
 */
@Configuration
public class ToolsInit {
    /**
     * 请假函数（小心循环依赖哦）
     *
     * @return 函数回调
     */
    @Bean
    public FunctionCallback askForLeaveCallback() {
        return FunctionCallback.builder()
                .function("askForLeave", new OAService())
                .description("当有人需要请假时返回请假的天数")
                .inputType(OAService.Request.class)
                .build();
    }
}
